﻿using Abp.Domain.Entities;
using Abp.Domain.Values;
using shenghua.Common.WordNodes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Basics.ShippingAddresses
{
    /// <summary>
    /// 收货地址，送货地址
    /// </summary>
    public abstract class ShippingAddress: Entity
    {
        public string PersonName { get; set; }
        public string PhoneNumber { get; set; }
        public string Province { get; set; }
        public string City { get; set; }
        public string County { get; set; }
        /// <summary>
        /// 详细地址
        /// </summary>
        public string DetailedAddress { get; set; }
        public bool IsDefault { get; set; }
        /// <summary>
        /// 组合后的完整地址
        /// </summary>
        public string FullAddress
        {
            get
            {
                return $"{PersonName} {PhoneNumber} {Province}{City}{County}{DetailedAddress}";
            }
        }

        public string StarredPhoneNumber
        {
            get
            {
                return $"{PhoneNumber.Substring(0, 3)}****{PhoneNumber.Substring(PhoneNumber.Length - 4, 4)}";
            }
        }

        public string AreaTag
        {
            get
            {
                return $"[{Province}][{City}][{County}]";
            }
        }
    }
}
